import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'styem',
      meta: {
        title: '系统管理'
      },
      component: HomeView,
      children: [
        {
          path: '/styem/menu',
          name: 'menu',
          meta: {
            title: '菜单管理'
          },
          component: () => import('../views/menu.vue')
        },
        {
          path: '/styem/department',
          name: 'department',
          meta: {
            title: '部门管理'
          },
          component: () => import('../views/department.vue')
        },
        {
          path: '/styem/gangwei',
          name: 'gangwei',
          meta: {
            title: '岗位管理'
          },
          component: () => import('../views/gangwei.vue')
        },
      ]
    },
    {
      path: '/home',
      name: 'home',
      meta: {
        title: '首页'
      },
      component: ()=>import('../views/home.vue'),
    }
  ]
})

export default router
